package jhlee42.swing;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Dimension;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JPasswordField;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class LoginManager_self extends JFrame {

	private JPanel contentPane;
	private JTextField uid;
	private JPasswordField pwd;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					LoginManager_self frame = new LoginManager_self();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public LoginManager_self() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 800, 600);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new BorderLayout(0, 0));
		
		JPanel titlePanel = new JPanel();
		titlePanel.setPreferredSize(new Dimension(10, 100));
		contentPane.add(titlePanel, BorderLayout.NORTH);
		titlePanel.setLayout(new BorderLayout(0, 0));
		
		JPanel loginPanel = new JPanel();
		loginPanel.setPreferredSize(new Dimension(250, 10));
		titlePanel.add(loginPanel, BorderLayout.EAST);
		
		
		
		
		
		
		
		
		
		
		
		
		
/****************************************************************/		
//		uid = new JTextField();
//		uid.setColumns(10);
//		JButton loginBtn = new JButton("로그인");
//		loginBtn.addActionListener(new ActionListener() {
//			public void actionPerformed(ActionEvent e) {
//			}
//		});
//		loginBtn.setMaximumSize(new Dimension(85, 23));
//		loginBtn.setPreferredSize(new Dimension(85, 23));
//		
//		
//		pwd = new JPasswordField();
//		JButton joinBtn = new JButton("회원 가입");
//		joinBtn.addActionListener(new ActionListener() {
//			public void actionPerformed(ActionEvent e) {
//			}
//		});
//		GroupLayout gl_loginPanel = new GroupLayout(loginPanel);
//		gl_loginPanel.setHorizontalGroup(
//			gl_loginPanel.createParallelGroup(Alignment.LEADING)
//				.addGroup(gl_loginPanel.createSequentialGroup()
//					.addContainerGap()
//					.addGroup(gl_loginPanel.createParallelGroup(Alignment.TRAILING, false)
//						.addComponent(pwd, Alignment.LEADING)
//						.addComponent(uid, Alignment.LEADING))
//					.addPreferredGap(ComponentPlacement.RELATED, 13, Short.MAX_VALUE)
//					.addGroup(gl_loginPanel.createParallelGroup(Alignment.TRAILING)
//						.addComponent(loginBtn)
//						.addComponent(joinBtn))
//					.addContainerGap())
//		);
//		gl_loginPanel.setVerticalGroup(
//			gl_loginPanel.createParallelGroup(Alignment.LEADING)
//				.addGroup(gl_loginPanel.createSequentialGroup()
//					.addContainerGap()
//					.addGroup(gl_loginPanel.createParallelGroup(Alignment.BASELINE)
//						.addComponent(uid, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
//						.addComponent(loginBtn))
//					.addGap(18)
//					.addGroup(gl_loginPanel.createParallelGroup(Alignment.BASELINE)
//						.addComponent(pwd, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
//						.addComponent(joinBtn))
//					.addContainerGap(28, Short.MAX_VALUE))
//		);
//		loginPanel.setLayout(gl_loginPanel);
//		
//		
		
		
		

/****************************************************************/	
		
		
		
		
		
		
		
		
		
/****************************************************************/		
	
		
		
		JPanel logoutPanel = new JPanel();
		logoutPanel.setPreferredSize(new Dimension(250, 10));
		titlePanel.add(logoutPanel, BorderLayout.WEST);
		
		JButton logoutBtn = new JButton("로그 아웃");
		logoutBtn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				
				
			}
		});
		logoutBtn.setPreferredSize(new Dimension(85, 23));
		
		JLabel lblNewLabel = new JLabel("");
		lblNewLabel.setPreferredSize(new Dimension(60, 60));
		lblNewLabel.setIcon(new ImageIcon(LoginManager_self.class.getResource("/images/background/cool1.jpg")));
		GroupLayout gl_logoutPanel = new GroupLayout(logoutPanel);
		gl_logoutPanel.setHorizontalGroup(
			gl_logoutPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_logoutPanel.createSequentialGroup()
					.addContainerGap()
					.addComponent(lblNewLabel, GroupLayout.PREFERRED_SIZE, 99, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.RELATED, 29, Short.MAX_VALUE)
					.addComponent(logoutBtn, GroupLayout.PREFERRED_SIZE, 98, GroupLayout.PREFERRED_SIZE)
					.addContainerGap())
		);
		gl_logoutPanel.setVerticalGroup(
			gl_logoutPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_logoutPanel.createSequentialGroup()
					.addGroup(gl_logoutPanel.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_logoutPanel.createSequentialGroup()
							.addContainerGap()
							.addComponent(lblNewLabel, GroupLayout.PREFERRED_SIZE, 83, GroupLayout.PREFERRED_SIZE))
						.addGroup(gl_logoutPanel.createSequentialGroup()
							.addGap(38)
							.addComponent(logoutBtn, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
					.addContainerGap(7, Short.MAX_VALUE))
		);
		logoutPanel.setLayout(gl_logoutPanel);
		
		
		
		
		
/****************************************************************/		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		contentPane.add(tabbedPane, BorderLayout.CENTER);
		
		JPanel panel_1 = new JPanel();
		panel_1.setToolTipText("");
		tabbedPane.addTab("기 본 검 색", null, panel_1, null);
		
		JPanel panel_2 = new JPanel();
		tabbedPane.addTab("상 세 검 색", null, panel_2, null);
		
		JPanel panel_3 = new JPanel();
		tabbedPane.addTab("마 이 페 이 지", null, panel_3, null);
		tabbedPane.setEnabledAt(2, false); // 비활성화
		
		
		
		
	} // LoginManager_self() 
} // main



class LoginPanel extends JPanel{
	public LoginPanel(){
		JTextField uid = new JTextField();
		
		
		
		uid.setColumns(10);
		JButton loginBtn = new JButton("로그인");
		loginBtn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		loginBtn.setMaximumSize(new Dimension(85, 23));
		loginBtn.setPreferredSize(new Dimension(85, 23));
		
		
		JPasswordField pwd = new JPasswordField();
		JButton joinBtn = new JButton("회원 가입");
		joinBtn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		GroupLayout gl_loginPanel = new GroupLayout(loginPanel);
		gl_loginPanel.setHorizontalGroup(
			gl_loginPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_loginPanel.createSequentialGroup()
					.addContainerGap()
					.addGroup(gl_loginPanel.createParallelGroup(Alignment.TRAILING, false)
						.addComponent(pwd, Alignment.LEADING)
						.addComponent(uid, Alignment.LEADING))
					.addPreferredGap(ComponentPlacement.RELATED, 13, Short.MAX_VALUE)
					.addGroup(gl_loginPanel.createParallelGroup(Alignment.TRAILING)
						.addComponent(loginBtn)
						.addComponent(joinBtn))
					.addContainerGap())
		);
		gl_loginPanel.setVerticalGroup(
			gl_loginPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_loginPanel.createSequentialGroup()
					.addContainerGap()
					.addGroup(gl_loginPanel.createParallelGroup(Alignment.BASELINE)
						.addComponent(uid, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(loginBtn))
					.addGap(18)
					.addGroup(gl_loginPanel.createParallelGroup(Alignment.BASELINE)
						.addComponent(pwd, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(joinBtn))
					.addContainerGap(28, Short.MAX_VALUE))
		);
		loginPanel.setLayout(gl_loginPanel);
		
		
	}
}
class LogoutPanel extends JPanel{
	public LogoutPanel(){
		
	}
}




